import request from "@/utils/request";
// GET /admin/acl/index/info
// POST /admin/acl/index/login
// POST /admin/acl/index/logout
interface IloginParams {
    username:string,
    password:string
};
interface ItokenModel {
    token:string
}
export interface IinfoModel {
    name:string,
    avatar:string,
    buttons:string[],
    roles:string[],
    routes:string[]
}

const login=(loginParams:IloginParams)=>{
    
    return request.post<any,ItokenModel>(`/admin/acl/index/login`,loginParams)
}
const info=()=> {
    return request.get<any,IinfoModel>('/admin/acl/index/info')
  }
const logout=()=>{
    return request.post<any,null>(`/admin/acl/index/logout`)
};
export default {
    login,
    info,
    logout
}